<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
if(isset($_POST))
{
    if(isset($_POST['submitL'])and $_POST['submitL']=="login")
    {
     $password= $_POST['password'];   
    $email=   $_POST['email'];
    try {
        include 'loginClass.php';
       $login= new loginClass($email,$password);
       if($login==TRUE)
       {
           $result=$login->getUser();
           session_start();
           $_SESSION['email']=$email;
           $_SESSION['usID']=$result['usID'];
           $_SESSION['stID']=$result['stID'];
           $d= $_SESSION['email'];
    $s="<a href='logout.php'>LogOut</a>";
           include 'index.php';
           
       }
    } catch (Exception $ex) {
    echo $ex->getMessage();    
    }    
    
    
    }
}